//导入请求响应拦截器
import request from '@/utils/request'
// 注册接口
// export const userRegisterService = ({ username, password, repassword }) => {
//   request.post('/api/reg', { username, password, repassword })
// }
export const userRegisterService = ({ username, password, repassword }) =>
  request.post('/api/reg', { username, password, repassword })

export const userLoginService = ({ username, password }) =>
  request.post('/api/login', { username, password })

// 获取用户信息模块
export const userGetInfoService = () => request.get('/my/userinfo')
//修改用户信息模块
export const userUpdateInfoService = ({ id, nickname, email }) =>
  request.put('/my/userinfo', { id, nickname, email })
//修改用户头像模块
export const userUploadAvatarService = (avatar) =>
  request.patch('/my/update/avatar', { avatar })
//修改密码
export const userUpdatePassService = ({ old_pwd, new_pwd, re_pwd }) =>
  request.patch('/my/updatepwd', { old_pwd, new_pwd, re_pwd })
